In [ ]:
library(magick)
In [9]:
im1 <- image_read('/opt/eodata/Landsat-5/TM/L1T/2011/07/15/LS05_RMTI_TM__GTC_1P_20110715T093254_20110715T093322_145580_0190_0023_F030/LS05_RMTI_TM__GTC_1P_20110715T093254_20110715T093322_145580_0190_0023_F030.BP.PNG')
print(im1)
In [17]:
image_negate(im1)
#image_oilpaint(frink)
#image_charcoal(frink)
#image_noise(frink)
#image_oilpaint(frink)
In [7]:
kern <- matrix(0, ncol = 3, nrow = 3)
kern[1, 2] <- 0.25
kern[2, c(1, 3)] <- 0.25
kern[3, 2] <- 0.25
kern
In [12]:
img_blurred <- image_convolve(im1, kern)
img_blurred
In [66]:
image_compare(im1,img_blurred)
Help and list of standard kernels can be found here: http://www.imagemagick.org/Usage/convolve/
In [14]:
im1 %>% image_convolve('Sobel') %>% image_negate()
In [24]:
image_crop(im1, "100x150+500x500")#: crop out width:100px and height:150px starting +500x500px
In [31]:
im1_scaled<-image_scale(im1, "200")#: resize proportionally to width: 200px
im1_scaled
#image_scale(image, "x200"): resize proportionally to height: 200px
In [30]:
image_border(im1, "red", "20x10")#: adds a border of 20px left+right and 10px top+bottom